﻿using ReflectionStudio.Core.Events;
using System;
using System.Data;
using System.Windows;
using System.Windows.Data;
using System.ComponentModel;
using WPFExcelReport.Helpers;
using System.Data.SqlClient;
using System.Data.Sql;
using System.Windows.Input;
namespace WPFExcelReport
{
    public partial class TGB11MX : UIVAKDBEZ
    {

   
        public TGB11MX()
        {
            if (DesignerProperties.GetIsInDesignMode(this))
                return;
            MV = new VVAKDBEZ();
            this.DataContext = MV;
            MESSAGES += "VAKDCHK;VAKDFARBECHG;";
            InitializeComponent();
               
         }

        public override void Window_Loaded(object sender, RoutedEventArgs e)
        {
            if (DesignerProperties.GetIsInDesignMode(this))
                return;
            if (IsLoaded)
                return;
            base.Window_Loaded(sender, e);
        }

        public override void vwMaster_CurrentChanged(object sender, EventArgs e)
        {
            base.vwMaster_CurrentChanged(sender, e);//
            dwVAK = dwMaster;
            if (dwMaster == null)
            {
                //KEY = "";
                TXTISIND = "";
            }
            else
            {             
                   
            }
        }
       
      
      

     
        public override void LOADBYAUF()
        {
            if (ORDERNUM == "") return;
            
            SResult = TMV.QGB02(ORDERNUM);
            MergeData(SResult, true);
            base.LOADBYAUF();
        }
      

       
        

      

        public void QUERY_KeyUp(object sender, System.Windows.Input.KeyEventArgs e)
        {
            if (e.Key == Key.Enter)
            {
                this.Focus();
                QueryCommand(null, null);
            }

        }
        
       
    }
}
